package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhPlatformSellPartsAttributeMapper;
import com.ruoyi.zsyh.domain.ZsyhPlatformSellPartsAttribute;
import com.ruoyi.zsyh.service.IZsyhPlatformSellPartsAttributeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 产品属性Service业务层处理
 * 
 * @author yuexl
 * @date 2025-04-27
 */
@Service
public class ZsyhPlatformSellPartsAttributeServiceImpl implements IZsyhPlatformSellPartsAttributeService 
{
    @Autowired
    private ZsyhPlatformSellPartsAttributeMapper zsyhPlatformSellPartsAttributeMapper;

    /**
     * 查询产品属性
     * 
     * @param id 产品属性ID
     * @return 产品属性
     */
    @Override
    public ZsyhPlatformSellPartsAttribute selectZsyhPlatformSellPartsAttributeById(String id)
    {
        return zsyhPlatformSellPartsAttributeMapper.selectZsyhPlatformSellPartsAttributeById(id);
    }

    /**
     * 查询产品属性列表
     * 
     * @param zsyhPlatformSellPartsAttribute 产品属性
     * @return 产品属性
     */
    @Override
    public List<ZsyhPlatformSellPartsAttribute> selectZsyhPlatformSellPartsAttributeList(ZsyhPlatformSellPartsAttribute zsyhPlatformSellPartsAttribute)
    {
        return zsyhPlatformSellPartsAttributeMapper.selectZsyhPlatformSellPartsAttributeList(zsyhPlatformSellPartsAttribute);
    }

    /**
     * 新增产品属性
     * 
     * @param zsyhPlatformSellPartsAttribute 产品属性
     * @return 结果
     */
    @Override
    public int insertZsyhPlatformSellPartsAttribute(ZsyhPlatformSellPartsAttribute zsyhPlatformSellPartsAttribute)
    {
        zsyhPlatformSellPartsAttribute.setCreateTime(DateUtils.getNowDate());
        return zsyhPlatformSellPartsAttributeMapper.insertZsyhPlatformSellPartsAttribute(zsyhPlatformSellPartsAttribute);
    }

    /**
     * 修改产品属性
     * 
     * @param zsyhPlatformSellPartsAttribute 产品属性
     * @return 结果
     */
    @Override
    public int updateZsyhPlatformSellPartsAttribute(ZsyhPlatformSellPartsAttribute zsyhPlatformSellPartsAttribute)
    {
        zsyhPlatformSellPartsAttribute.setUpdateTime(DateUtils.getNowDate());
        return zsyhPlatformSellPartsAttributeMapper.updateZsyhPlatformSellPartsAttribute(zsyhPlatformSellPartsAttribute);
    }

    /**
     * 删除产品属性对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPlatformSellPartsAttributeByIds(String ids)
    {
        return zsyhPlatformSellPartsAttributeMapper.deleteZsyhPlatformSellPartsAttributeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除产品属性信息
     * 
     * @param id 产品属性ID
     * @return 结果
     */
    @Override
    public int deleteZsyhPlatformSellPartsAttributeById(String id)
    {
        return zsyhPlatformSellPartsAttributeMapper.deleteZsyhPlatformSellPartsAttributeById(id);
    }

    @Override
    public int updateAttributeSort(int changeValue, String partsId, long attributeSort) {
        return zsyhPlatformSellPartsAttributeMapper.updateAttributeSort(changeValue,partsId,attributeSort);
    }

    @Override
    public int updateAttributeSortBefore(int changeValue, String partsId, long attributeSort, long attributeSortOld) {
        return zsyhPlatformSellPartsAttributeMapper.updateAttributeSortBefore(changeValue,partsId,attributeSort,attributeSortOld);
    }
}
